Django admin and bootstrap 5
You can also be interested in:
Bootstrap 5 has come, currently in beta release, and seems already very stable.
So the question is: are you looking for a Django admin application based on it?
If yes, then Django Baton V2 is what you're looking for. V2 is a major release of Baton, an admin interface package for Django which has been around since 2017. Currently developed in a specific branch, which is already very stable and used in production in many projects, V2 can be tried in a demo site and installed with pip.
You can try the demo at the following URL: https://django-baton-demo.herokuapp.com
login with username demo and password demo.
You can install it with pip and try it directly in you project:
$ pip install https://github.com/otto-torino/django-baton/archive/v2.zip
Let's see in detail the main features added to Baton V2.
Bootstrap 5
Obviously, as the post title states, Baton V2 is based on Bootstrap 5. The dependency from jQuery has not been dropped, because it's currently used a lot, and Font Awesome 5 is used in place of Bootstrap icons which still lack some stuff.
Django 1.x
Baton V2 drops support for old Django versions and requires Django >= 2.1. If you still need to use it in a previous Django release, you must install Baton V1, the current release is 1.13.2.
Login Page
The login page can now be customized providing a background image which is centered and covers the whole viewport. Also, the toggle password visibility icon was added to the password input field.
# settings.py BATON = { # ... 'LOGIN_SPLASH': '/static/core/img/login-splash.png', # ... }
Changelist Filters Includes
Baton V2 adds the possibility to include HTML templates directly inside the changelist filter panel, at the top or the bottom. This functionality is very similar to the other include functionalities:
@admin.register(News) class NewsAdmin(admin.ModelAdmin): #... baton_cl_filters_includes = [ ('news/admin_filters_include_top.html', 'top', ), ('news/admin_filters_include_bottom.html', 'bottom', ) ]
Changelist Filters Form
This is a nice addition. There's a thing which drives me mad sometimes when using Django admin filters: the fact that they are applied one at a time, and every time the page reloads. With this option, you can turn your filter panel into a filter form. It means that you can set all the filters you desired, and then press a button to submit the search. In order to do that, all "default" filters are rendered as dropdowns. It works also with the Baton InputFilter facility and the well known django-admin-rangefilter package.
Summary
Django Baton V2 is a major release which brings in the new Bootstrap 5 CSS framework. It also adds some other nice feature, ane more will probably be added in the next future. It's already very stable and you can try it now!
Your Smartwatch Loves Tasker!
Your Smartwatch Loves Tasker!
Featured
Archive
- 2021
- 2020
- 2019
- 2018
- 2017
- Nov
- Oct
- Aug
- Jun
- Mar
- Feb
- 2016
- Oct
- Jun
- May
- Apr
- Mar
- Feb
- Jan
- 2015
- Nov
- Oct
- Aug
- Apr
- Mar
- Feb
- Jan
- 2014
- Sep
- Jul
- May
- Apr
- Mar
- Feb
- Jan
- 2013
- Nov
- Oct
- Sep
- Aug
- Jul
- Jun
- May
- Apr
- Mar
- Feb
- Jan
- 2012
- Dec
- Nov
- Oct
- Aug
- Jul
- Jun
- May
- Apr
- Jan
- 2011
- Dec
- Nov
- Oct
- Sep
- Aug
- Jul
- Jun
- May